// 图例
import { cloneDeep } from 'lodash'

const legend = () => {
  return {
    legend: {
      position: 'top',
      offsetX: 0,
      offsetY: 0
    }
  }
}

const line = () => {
  return {
    smooth: false,
    lineStyle: {
      lineWidth: 2
    },
    ...legend()
  }
}

const area = () => {
  return {
    ...legend(),
    smooth: false,
    line: {
      size: 2
    }
  }
}


const showConfig = {
  line: line(),
  stepLine: {
    ...legend(),
    stepType: 'hv',
    lineStyle: {
      lineWidth: 2
    }
  },
  area: area(),
  stackArea: area(),
  bar: {
    ...legend(),
  },
  groupBar: {
    ...legend(),
  },
  stackBar: {
    ...legend(),
  },
  column: {
    ...legend(),
    columnSize: null
  },
  groupColumn: {
    ...legend(),
  },
  stackColumn: {
    ...legend(),
  },
  wordCloud: {
    spiral: 'archimedean'
  },
  pie: {
    ...legend(),
    radius: 0.9
  },
  funnel: {
    ...legend(),
  },
  ring: {
    ...legend(),
    radius: 0.9,
    innerRadius: 0.64
  },
  liquid: {

  },
  radar: {
    radius: 0.8,
    smooth: false,
    lineStyle: {
      lineWidth: 2
    },
    ...legend()
  },
  gauge: {
    radius: 0.95,
    innerRadius: 0.9
  },
  number: {

  },
  multipleNumber: {

  },
  trendNumber: {

  },
  carousel: {
    autoplay: false,
    dotPosition: 'bottom',
    dots: true,
    effect: 'scrollx'
  },
  markdown: {
    
  }
}

export default (type) => {
  return showConfig[type] ? cloneDeep(showConfig[type]) : {}
}